<?php
/**
 * Created by PhpStorm.
 * User: ls721
 * Date: 2016/10/27 0027
 * Time: 23:23
 */class Model_Handle extends PhalApi_Model_NotORM {
    public function getHandle($handle_id)
    {
        return  $this->getORM() ->select(
            'Handle.id as HandleId',
            'Event_id as EventId',
            'Doctor_id as DoctorId',
            'Doctor.Name',
            'Handle.Handle',
            'Handle.CreateDate')
            ->where('Handle.id', $handle_id)
            ->fetch();
    }
    public function listHandle($event_id){
        return $this->getORM()
            ->select('Handle.id as HandleId','Doctor.Name as DoctorName','Handle','CreateDate')
            ->where('Event_id',$event_id)
            ->fetchRows();

    }


    protected function getTableName($id) {
        return 'Handle';
    }
}